package com.yookey.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 用户表
 *
 * @author yww
 * @date 2020/9/29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "account")
@ApiModel(value="Account对象", description="")
public class Account {
    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 登录账号
     */
    @ApiModelProperty(value = "登录账号")
    @TableField(value = "username")
    private String username;


    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @JsonIgnore
    @TableField(value = "password")
    private String password;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    @TableField(value = "avatar")
    private String avatar;

    /**
     * 性别(0-默认未知,1-男,2-女)
     */
    @ApiModelProperty(value = "性别(0-默认未知,1-男,2-女)")
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 电子邮件
     */
    @ApiModelProperty(value = "电子邮件")
    @TableField(value = "email")
    private String email;

    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    @TableField(value = "phone")
    private String phone;

    /**
     * 状态(1-正常,0-冻结)
     */
    @ApiModelProperty(value = "状态(1-正常,0-冻结)")
    @TableField(value = "status")
    private Integer status;

    /**
     * 删除状态(0-正常,1-已删除)
     */
    @TableLogic
    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
    @JsonIgnore
    @TableField(value = "del_flag")
    private Integer delFlag;

    /**
     * 创建人
     */
    @JsonIgnore
    @ApiModelProperty(value = "创建人")
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新人
     */
    @JsonIgnore
    @ApiModelProperty(value = "更新人")
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time")
    private Date updateTime;

}